package com.zshan.clinic.web.handler;

import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import org.apache.poi.ss.usermodel.Sheet;

public class FreezeTopRowHandler implements SheetWriteHandler {
    @Override public void beforeSheetCreate(WriteWorkbookHolder w, WriteSheetHolder s) { }
    @Override public void afterSheetCreate(WriteWorkbookHolder w, WriteSheetHolder s) {
        Sheet sheet = s.getSheet();
        // 冻结首行：第一行标题固定
        sheet.createFreezePane(0, 1);
    }
}

